//杨辉三角

#include<iostream>
using namespace std;

int  a[30][30];
int  n;
int main()
{
	a[1][1] = 1;
	cout << "请输入行列：" << endl;
	cin >> n;
	cout << "结果如下" << endl;
	for (int i = 2; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)

		{
			a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
		}
	}
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= i; j++)
		{
			cout << a[i][j];
			cout << " ";
		}
		cout << endl;
	}
	return 0;
}